package com.example.mapper;

import com.example.pojo.TbBook;
import com.example.pojo.TbBookBase;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Author:20201002983_郑雨蓓
 * Date: 2022/12/18
 * Description:
 */
@Mapper
@Repository
public interface TbBookBaseMapper {
    List<TbBookBase> list();

    TbBookBase selectById(@Param("bookId") Long bookId);

    List<TbBookBase> selectByCategoryId(@Param("categoryId") Long id);

    List<TbBookBase> selectByName(@Param("bookName") String bookName);

    List<TbBookBase> selectByWriter(@Param("writerName") String writerName);

    List<TbBookBase> selectByMulCon(TbBookBase tbBook);
    int add(@Param("book") TbBookBase tbBook);
    //部分插入
    int add2(@Param("book") TbBookBase tbBook);

    int update(@Param("book") TbBookBase tbBook);

    int updateSellingPrice(@Param("sellingPrice") Integer sellingPrice, @Param("bookId") long bookId);

    int delete(Long id);
}
